package com.lwp.test.spring;

import cn.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ApplicationContextEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.stereotype.Component;

/**
 * 监听类实例化后,只监听指定 ApplicationContextEvent 事件
 * <p>
 *     ContextRefreshedEvent , 扫描的类已经实例化完成
 * </p>
 */
@Component
public class ApplicatiListener1 implements ApplicationListener<ApplicationContextEvent> {


    /**
     * ok
     * @param event
     */
    @Override
    public void onApplicationEvent(ApplicationContextEvent event) {
        System.out.println("********* ApplicatiListener1  8888888888888888888888888 " + event.getClass().getName());
    }
}
